package com.lgt_enterprise_android.view.dialogs;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

import com.lgt_enterprise_android.R;

public class ArrangeJobDialog extends Dialog {

    public ArrangeJobDialog(Context context) {
        super(context, R.style.Theme_AppCompat_Dialog);
        setOwnerActivity((Activity) context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.include_arrange_job_right);
        //按空白处不能取消动画
        setCanceledOnTouchOutside(true);

        Window window = getWindow();
        WindowManager.LayoutParams attr = window.getAttributes();
        if (attr != null) {
            attr.height = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
            attr.gravity = Gravity.RIGHT;
        }
        window.setDimAmount(0);
        //设置window背景，默认的背景会有Padding值，不能全屏。当然不一定要是透明，你可以设置其他背景，替换默认的背景即可。
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        //一定要在setContentView之后调用，否则无效

    }


    @Override
    public void show() {
        super.show();
    }
}